package task15;

import java.util.Scanner;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/13 9:25
 * @description:
 */
public class PrinterTest {

  public static void main(String[] args) {
    System.out.println("请输入0表示惠普，1表示佳能");
    Scanner scanner = new Scanner(System.in);
    int a= scanner.nextInt();

    PrinterFactory pf = new PrinterFactory();
    Printer printer=pf.getprinter(a);
    printer.close();
    printer.Print();
    printer.open();

    /*if(a==0){
      HPrinter hPrinter=new HPrinter();
      hPrinter.close();
      hPrinter.Print();
      hPrinter.open();
    }else if(a==1){
      CPrinter cPrinter=new CPrinter();
      cPrinter.open();
      cPrinter.Print();
      cPrinter.close();
    }else{
      System.out.println("输入有误");
    }*/
  }

}
